package com.gusha.model;

import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


/**
 * @Created：2018-10-26 15:18:16
 * @Author LightSound的代码生成器
 * @Description:SysRoleMenu实体类
 */
@Entity
@Table(name="sys_role_menu")
@NamedQuery(name="SysRoleMenu.findAll", query="SELECT s FROM SysRoleMenu s")
@DynamicInsert
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SysRoleMenu implements Serializable {

    private static final long serialVersionUID = 1L;
    
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)    
    private BigInteger id;
    
    @ManyToOne(fetch=FetchType.LAZY)
   	@NotFound(action=NotFoundAction.IGNORE)
   	@JoinColumn(name="role_id")
   	private SysRole role;
    
    @ManyToOne(fetch=FetchType.LAZY)
   	@NotFound(action=NotFoundAction.IGNORE)
   	@JoinColumn(name="menu_id")
    private SysMenu menu;

	public BigInteger getId() {
		return id;
	}

	public void setId(BigInteger id) {
		this.id = id;
	}

	public SysRole getRole() {
		return role;
	}

	public void setRole(SysRole role) {
		this.role = role;
	}

	public SysMenu getMenu() {
		return menu;
	}

	public void setMenu(SysMenu menu) {
		this.menu = menu;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
    
    

}
